<!DOCTYPE html>
<html style="background: #FFFFFF;">
	<head>
		<meta charset="utf-8">
		<title>LingPowerAI</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
		<script type="text/javascript">
			document.write('<script src="../../js/fix.js?rd=?rd=' + Math.random() + '"><\/script>');
		</script>
		<script src="../../js/PinYinUti.js"></script>
		<script src="../../js/H5+.js"></script>
		<script type="text/javascript">
			link(['../../css/reset.css','../../fonts/iconfont/iconfont.css']);
		</script>
		<style type="text/css">
			.pick_photo {
				width: 0.6rem;
				height: 0.6rem;
			}

			.display-inline {
				display: inline-block;
			}


			label,
			i {
				color: #5A5A5A;
			}

			.card-dash {
				width: 100%;
				background-color: #FFFFFF;
				margin-top: 0.1rem;
				padding: 0.1rem 0.1rem;
			}

			.i_blue {
				color: #47BAFE
			}

			.cont_table td {
				width: 25%;
				text-align: center;
				border-right: 0.01rem solid #c0d3df;
			}

			.cont_table td:last-child {
				border: none;
			}

			.cont_table td label {
				display: block;
			}

			.left-border3 {
				border-left: 0.03rem solid #47BAFE;
			}

			.float-m9 {
				margin: 0.08rem auto 0;
				width: 100%;
			}

			.clear2 {
				margin: 0.02rem 0;
			}

			.clear5 {
				margin: 0.05rem 0;
			}

			.clear10 {
				margin: 0.1rem 0;
				display: inline-block;
				width: 100%;
				border-top: 0.01rem solid #c0d3df;
				padding: 0 0.1rem;
			}

			.progress {
				height: 1rem;
				width: 1.2rem;
				display: inline-block;
				width: 30%;
			}

			.progress>svg {
				height: 100%;
				display: block;
			}

			.progressbar__label {
				text-align: center;
			}

			.div_tags {
				display: inline-block;
				vertical-align: top;
				width: 60%;
				margin-left: 0.2rem;
				margin-top: 0.2rem;
			}

			.tags {
				display: inline-block;
				padding: 0.02rem 0.1rem;
				margin: 0.05rem;
				background-color: #9a9a9a;
				color: #fff;
				border-radius: 4px;
			}

			.tips {
				color: #5A5A5A;
				font-size: 0.1rem;
				display: flex;
			}

			.sp_date {
				padding: 0.2rem;
				display: block;
				background-color: #47BAFE;
			}

			.sp_month {
				display: block;
				color: #47BAFE;
			}

			.div_ac_type {
				padding: 0.01rem 0.05rem;
				border: grey solid 0.01rem;
				vertical-align: middle;
			}

			.bg_color_blue1 {
				background-color: #186FFF;
			}

			.bg_color_blue2 {
				background-color: #0DA3FF;
			}

			.bg_color_blue3 {
				background-color: #05CDE5;
			}

			.bg_color_green {
				background-color: #03D58D;
			}

			.span_product {
				color: #9C9C9C;
				padding: 0.05rem 0.1rem;
				border: grey solid 0.01rem;
				width: 0.8rem;
				word-break: normal;
				display: inline-block;
				white-space: pre-wrap;
				word-wrap: break-word;
				overflow: hidden;
			}

			ul {
				padding-left: 0;
				width: 100%;
				margin: 0 auto;
			}

			/* li{ padding:5px 0!important;margin: 0 auto;} */
			.fa-mobile {
				font-size: 0.18rem;
			}

			.star {
				display: inline-block;
				width: 0.16rem;
				height: 0.16rem;
				background: url(../../images/kx.png) no-repeat;
				background-size: 100% 100%;
			}

			.card-dash {
				padding: 0.1rem 0.15rem;
			}

			.mui-collapseli {
				position: relative;
				display: flex;
				align-items: center;
				padding: 0.1rem 0.1rem;
				border-bottom: .5px solid #c8c7cc;
			}


			.mui-collapseli .div_date {
				flex: 2;
				display: flex;
				flex-direction: column;
				align-items: center;
			}

			.mui-collapseli .div_date .sp_date {
				width: 0.37rem;
				height: 0.37rem;
				display: flex;
				justify-content: center;
				line-height: 0px;
				border-radius: 4px;
				color: white;
			}

			.mui-collapseli .div_plan {
				flex: 5;
				display: flex;
				flex-direction: column;
				justify-content: flex-start;
			}

			.mui-collapseli .div_plan span {
				color: #5a5a5a;
				font-size: 0.12rem;
			}

			.mui-collapseli .div_plan span:first-child {
				font-size: 0.16rem;
				color: #000000;
			}

			.div_ac_type {
				background-color: #47BAFE !important;
				border: 0;
				border-radius: 6px;
			}

			.div_products {
				display: flex;
				justify-content: space-around;
			}

			.div_products span {
				border-radius: 8px;
			}

			.xuan {
				color: white;
				background-color: #9c9c9c;
			}

			.div_name {
				display: flex;
				align-items: flex-start;
			}

			.sp_log_type,
			.sp_ac_type {
				color: white;
				line-height: 0.35rem;
				font-size: 0.13rem !important;
			}

			#topPopover {
				position: fixed;
				top: 0.1rem;
				width: 1.5rem;
				right: 0.1rem;
				z-index: 3;
				display: none;
				margin-right: -0.05rem;
			}

			#topPopover:before {
				content: '';
				width: 0;
				height: 0;
				border: 0.1rem solid transparent;
				/*调整小三角形的大小*/
				border-bottom-color: white;
				position: absolute;
				right: 0.1rem;
				/*调整小三角形的位置*/
				bottom: 100%;
				/*调整小三角形的位置*/
				margin-top: 0.2rem;
				/*调整小三角形的位置*/

			}

			#topPopover .mui-scroll-wrapper {
				margin-top: 0.05rem;
			}

			.mui-popover.mui-active {
				width: 1.4rem;
				background-color: white;
				display: block;
				top: 0.5rem !important;
			}

			#topPopover .mui-scroll li span {
				margin-right: 0.1rem;
			}

			#topPopover .more_ul:before,
			.more_ul:after {
				background: none;
			}

			#topPopover .more_ul {
				border-radius: 5px;
				overflow: hidden;
			}

			#topPopover .more_ul li {
				padding: 0px;
				border: none;
				padding-left: 0.2rem;
				padding-top: 0.04rem;
				height: 0.45rem;
				line-height: 0.45rem;
			}

			.mui-hidden {
				z-index: 1;
			}

			.mask {
				position: fixed;
				width: 100vw;
				height: 100vh;
				background-color: rgba(0, 0, 0, 0.3);
				z-index: 2;
				top: 0rem;
				display: none;
			}

			.mui-collapseli {
				padding-left: 0.05rem;
				padding-right: 0.05rem;
			}



			.voice {
				position: relative;
				display: inline-block;
				width: 65%;
				height: 0.3rem;
				line-height: 0.3rem;
				margin-bottom: 0.05rem;
				background: #eee;
				color: #47BAFE !important;
				border-radius: 0 0.07rem 0.07rem;
			}

			.bg {
				background: url("") right 0 no-repeat;
				width: 0.2rem;
				height: 0.2rem;
				background-size: 400%;
				margin-top: 0.05rem;
				margin-left: 0.1rem;
				display: inline-block;

			}

			.voicePlay {
				animation-name: voicePlay;
				animation-duration: 1s;
				animation-direction: normal;
				animation-iteration-count: infinite;
				animation-timing-function: steps(3);
			}

			@keyframes voicePlay {
				0% {
					background-position: 0;
				}

				100% {
					background-position: 100%;
				}
			}

			.chaochu {
				display: inline-block;
				white-space: nowrap;
				text-overflow: ellipsis;
				overflow: hidden;

			}

			.audiotip {
				position: absolute;
				top: 0px;
				display: block;
				background-color: rgba(0, 0, 0, 0.59);
				color: #FFFFFF;
				padding: 0.05rem 0.05rem;
				border-radius: 5px;

			}

			.opentiPrant {
				overflow: hidden;
				width: 95%;
				text-overflow: ellipsis;
				white-space: nowrap;
			}

		

			.mui-popup-button:first-child {
				color: #999999;
			}

			.wxmoment_text {
				overflow: hidden;
				text-overflow: ellipsis;
				box-sizing: content-box;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
				font-size: 0.15rem !important;
			}

			.linspan_wx {
				margin-left: 0rem;
				display: -webkit-box;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
				font-size: 0.13rem !important;
				min-height: 0.4rem;
			}

			.wxmoment_link {
				background: #EEEEEE;
				margin: 0.05rem 0rem;
				padding: 0.0rem 0.05rem;
				line-height: 0.18rem;
				vertical-align: middle;

			}

			.wxmoment_link img {
				height: 0.3rem;
				width: 0.3rem;
				margin-right: 0.05rem;
				vertical-align: middle;
				margin-top: 0.05rem;
				/* width: inherit; */
			}

			.emoji {
				background-image: url(../../images/emoji/emoji.png);
				background-repeat: no-repeat;
				background-size: 1300%;
				height: 0.2rem;
				background-position: center;
				display: inline-block;
				width: 0.2rem;
				margin: 0px 0.01rem;
				transform: translateY(0.05rem);
			}

			.emojiWuLian {
				background-image: url(../../images/emoji/WuLian.png) !important;
				background-size: cover;
			}

			.emojiCiYa {
				background-image: url(../../images/emoji/CiYa.png) !important;
				background-size: cover;
			}

			.emojiGuZhang {
				background-image: url(../../images/emoji/GuZhang.png) !important;
				background-size: cover;
			}

			.emojiXiGua {
				background-image: url(../../images/emoji/XiGua.png) !important;
				background-size: cover;
			}

			.insertBx {
				text-align: center;
				background: #EEEEEE;
				border-color: #EEEEEE;
				margin: 0.2rem 0px 0.2rem 20%;
				height: 0.4rem;
				width: 60%;
				color: #999;
				font-size: 0.16rem;
			}
			.insertBx:active{
				background: none !important;
			}
			.insertBx>span {
				border-radius: 50%;
				font-size: 0.25rem !important;
				margin-right: 0.05rem;
			}
			.mui-checkbox input[type=checkbox]:before, .mui-radio input[type=radio]:before{
				font-size: 18px !important;
				}
						.mui-popup-button:first-child{
					color: #47BAFE;
				}
				.mui-popup-button-bold{
					color: #47BAFE !important;
				}
					
					
					.mask_navBox {
						position: fixed;
						display: none;
						top: 0rem;
						left: 0rem;
						height: 100%;
						width: 100%;
						z-index: 1000;
						background-color: rgba(0, 0, 0, 0.7);
					}
					
					
					.mask_navBox .text {
						margin: 0.15rem 0.15rem;
						font-size: 0.2rem;
						color: #FFFFFF;
						line-height: 0.33rem;
					}	
					.mask_navBox .btn {
						display: block;
						width: 1.2rem;
						float: right;
						border-radius: 10px;
						color: #FFFFFF;
						margin-right: 0.2rem;
						font-size: 0.22rem;
						height: 0.4rem;
						transform: translateY(-0.1rem);
						line-height: 0.4rem;
						box-sizing: content-box;
						text-align: center;
						border: 0.03rem solid #FFFFFF;
					}
					.mask_nav .img{
						text-align: right;
						height: 1.3rem;
						line-height: 1.3rem;
						padding-right: 0.15rem;
					}
					.mask_nav .img img{
						width: 0.35rem;
						vertical-align: middle;
					}
					.mask_nav .jiantou{
						margin: 0 auto;
						margin-right: 0.5rem;
						display: block;
						height: 2rem;
						transform: rotate(-10deg)  translateY(-0.4rem);
					}
					.mask_navBox .text {
						margin: 0.15rem 0.15rem;
						font-size: 0.2rem;
						color: #FFFFFF;
						line-height: 0.33rem;
					}
					
		</style>
	</head>
	<body style="display: none;">
				<div class="mask_navBox" id="mask_navBox">
					<div class="mask_nav" id="mask_nav1">
						<div class="img" alt="">
							<img src="../../images/mask_nav/customerEdit.png" >
						</div>
						<img src="../../images/mask_nav/jiantou.png" class="jiantou" >
						<div class="text">
							1. 点击右上角箭头，可以
							<span style="color: #ee630e;">编辑补充客户信息，获得更完善画像</span>
						</div>
						<a href="javascript:;" class="btn" onclick="mask_nav(1)">下一步</a>
					</div>
					
					<div class="mask_nav" id="mask_nav2" style="display: none;">
						<div class="text" style="margin-top:0.5rem;">
							2. 点击勾选，可以针对重点客户<span style="color: #ee630e;">使用灵豹券</span>，获得更精准分析
						</div>
						<a href="javascript:;" class="btn" onclick="mask_nav(2)">知道了</a>
						<img src="../../images/mask_nav/jiantou.png" class="jiantou" style="transform: translateY(20px);margin-right: 0.15rem;" >
					     <img src="../../images/mask_nav/LBJ.png" style="margin-left: 0.15rem;margin-top: 0.5rem;border-radius: 10px;height: 0.3rem;" alt="">
					</div>
				</div>
		<!-- 		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-back mui-pull-left" id="btn_back"></a>
			<h1 class="mui-title" id="title_name"></h1>
			<a class="mui-pull-right mui-icon mui-icon-more-filled" id="btn_more" href="#topPopover"></a>
		</header> -->
		<!-- 	<div class="mui-content mui-scroll-wrapper scroll" id="pullrefresh">
			<div class="mui-scroll"> -->
			<div id="lodingGif" style="color: #999999;text-align: center;height: 100vh; line-height: 100vh;background: #FFFFFF;">
				<img src="../../images/loadding.gif" style="width: 0.4rem; height: 0.4rem;vertical-align: middle;transform: translateY(-50px);" alt="">
			</div>
		<div class="mui-content " style="display: none;" id="pullrefresh">
			<div class="mask" id="mask"></div>
			<div>
				<div class="border-solid card-dash" id="baseInfo_div">
					<table class="float-m9" style="padding:0.1rem 0;">
						<tr onclick="gotoEdit()">
							<td style="width:0.8rem;">
								<img class="pick_photo" data-preview-group="1" src="../../images/mrtxM.jpg" />
							</td>
							<td>
								<div id="div_name"><label style="font-size:0.14rem;font-weight: bold;padding: 0 0.05rem;color:#000;">
									</label>
									<img src="../../images/kx.png" alt="" width="0.15rem" height="0.15rem">
								</div>
								<div id="div_concat">
									<div id="div_wx" class="display-inline"><i class="mui-icon fa fa-weixin"></i>&nbsp;<label id="label_wx">
											<a href="javascript:;"   style="color: #545454;font-size: 0.13rem;">(点击绑定)</a>
										</label></div>
									<div id="div_phone" class="display-inline" style="margin-left:0.15rem;"><i class="mui-icon fa fa-mobile"></i>&nbsp;<label
										 id="label_wx">
											<a href="javascript:;" style="color: #545454;font-size: 0.13rem;">(点击绑定)</a>
										</label></div>
									<div id="div_lastInteract"><label>上次互动：</label><label id="label_lastInteract" style="font-size: 0.13rem;">
											暂无互动
										</label></div>
									<div id="div_inputType"><label id="label_inputType" style="font-size: 0.13rem;">
											通讯录导入
										</label><label id="label_inputDate" style="font-size: 0.13rem;"></label></div>
								</div>
							</td>
							<td style="width:0.25rem;">
								<i class="mui-icon mui-icon-forward"></i>
							</td>
						</tr>
					</table>
					<span class="clear10"></span>
					<table class='cont_table float-m9' style="padding:0.1rem 0.1rem;">
						<tr>
							<td><a href="javascript:;"><i class="i_blue mui-icon mui-icon-phone-filled"></i><label>电话</label></a></td>
							<td><a href="javascript:;"><i class="i_blue mui-icon mui-icon-map"></i><label>导航</label></a></td>
							<td><a href="javascript:;"><i class="i_blue mui-icon mui-icon-weixin"></i><label>微信</label> </a></td>
						</tr>
					</table>
				</div>
				<div class="border-solid card-dash" id="customer-lb-info">
					<div class="left-border3 float-m9" style="padding-left:0.05rem ;"><label style="font-size: 0.16rem; font-weight: 700;">灵豹智能分析</label></label>
					</div>
					<div class="clear5 mui-table-view"></div>
					<div class="div_lbscore float-m9">
						<div class="progress" id="progress"></div>
						<div class="div_tags tagList" id="score_label"></div>
						<span class="tips" style="color: #47BAFE;">  
						<div class="mui-input-row mui-checkbox mui-left" id="lingBaoreelBox">
					  <label style="padding-left: 0.25rem;color: #47BAFE;font-size: 0.13rem;">使用灵豹劵，获得更加精准分析</label>
					  <input id="lingBaoreel"  name="checkbox1" style="left: 0rem;top: 0.08rem;" value="true" type="checkbox">
					</div>
					</span>
					</div>
				</div>
				<!-- 	<div class="border-solid card-dash mui-hidden" id="schedule_plan">
					<div class="left-border3 float-m9" style="padding-left:5px ;"><label style="font-size: 16px; font-weight: 700;">日程计划</label><label id="schedule_count"></label></div>
					<hr class="float-m9" style="border:1px solid #EAE7E7;"/>
					<ul id="schedule_m" class="mui-table-view"></ul>
					<div class="div_plan_showmore float-m9" style="text-align: center;">展开全部>></div>
				</div> -->
				<div class="border-solid card-dash " id="action_sujest">
					<div class="left-border3 float-m9" style="padding-left:0.05rem ;margin-bottom: 0.1rem;"><label style="font-size: 0.17rem;font-weight: 700;">行动推荐</label><label
						 id="action_count"></label></div>
					<!-- <hr class="float-m9" style="border:1px solid #EAE7E7;" /> -->
					<ul id="action_m" class="mui-table-view"></ul>
					<!-- 	<div id="action_noData" style="text-align: center;">
						<img src="../../images/no_data.png" style="height: 1rem;margin: 0 auto;" alt="">
						<p style="text-align: center;">空空如也</p>
					</div> -->
					<p id="action_noData" style="text-align: center;height: 0.5rem;line-height: 0.5rem; margin:0rem;">
						暂无推荐
					</p>
					<!-- <div class="div_action_showmore float-m9" style="text-align: center;">展开全部>></div> -->
				</div>

				<div class="border-solid card-dash " id="schedule_history">
					<div class="left-border3 float-m9" style="padding-left:0.05rem ;margin-bottom: 0.1rem;"><label style="font-size: 0.17rem;font-weight: 700;">互动记录</label><label
						 id="history_count"></label></div>
					<!-- <hr class="float-m9" style="border:1px solid #EAE7E7;" /> -->
					<ul id="sHistory_m" class="mui-table-view">
						<!--  -->

					</ul>
					
					<button id="insertAudio_btn" type="button" class=" insertBx"><span class="mui-icon mui-icon-plusempty"></span>记录笔记</button>


					<!-- <div class="div_action_showmore float-m9" style="text-align: center;">展开全部>></div> -->
				</div>
				<div class="border-solid card-dash" id="wechat_friends">
					<div class="left-border3 float-m9" style="padding-left:0.05rem ;margin-bottom: 0.1rem;"><label style="font-size: 0.17rem;font-weight: 700;">最近动态</label><label
						 id="wechat_count"></label></div>
					<!-- <hr class="float-m9" style="border:1px solid #EAE7E7;" /> -->
					<ul id="wfriends_m" class="mui-table-view">

					</ul>
					<p id="wfriends_noData" style="text-align: center;height: 0.5rem;line-height: 0.5rem; margin:0rem;">暂无动态</p>
					<!-- <div class="div_action_showmore float-m9" style="text-align: center;">展开全部>></div> -->
				</div>
				<div class="border-solid card-dash" id="bx_con">
					<div class="left-border3 float-m9" style="padding-left:0.05rem ;"><label style="font-size: 0.17rem; font-weight: 700;">保险组合</label><label
						 id="insurance-count">（0份）</label>
						<span style="float: right;transform: translateY(-0.05rem); padding: 0.05rem 0.1rem;" id="shareBx"><i class="iconfont">&#xe63a;</i></span>
					</div>
					<div class="div_action float-m9">
							<ul class="mui-table-view" id="baoxian_Ul" style="clear: both;">
							
							</ul>
					</div>
					<button id="insertBx_btn" type="button" class=" insertBx"><span class="mui-icon mui-icon-plusempty"></span>添加保险</button>
					<!-- 		<div class="div_products float-m9" style="margin: 0.15rem 0;">
						<span class="span_product">保险需求测评结果</span>
						<span class="span_product xuan">保险需求测评结果</span>
						<span class="span_product">保险需求测评结果</span>
					</div> -->
					<br>
					<!-- <hr class="float-m9" style="border:0.01rem solid #EAE7E7;" /> -->
					<!-- <div class="div_action_showmore float-m9" style="text-align: center;">智能推荐产品<i class="mui-icon fa fa-angle-double-right"></i></div> -->
				</div>
			</div>
			<div id="topPopover">
				<div class="mui-popover-arrow"></div>
				<ul class="mui-table-view more_ul">
					<li class="mui-table-view-cell" onclick="gotoEdit()">
						<span class="mui-icon fa fa-edit"></span>
						<span>编辑资料</span>
					</li>
					<li class="mui-table-view-cell" onclick="deteleCustomer()">
						<span class="mui-icon fa fa-remove"></span>
						<span style="margin-left: 0.02rem;" id="deleteCustomer">删除客户</span>
					</li>
				</ul>

			</div>

			<script type="text/html" id="baseInfo">

				{{each DATASET as val}} {{if val!=''}}
			<table class="float-m9" style="padding:0.1rem 0;" >
				<tr  onclick="gotoEdit()">
					<td style="width:0.8rem;">
						{{if val.wechat_img!="" && val.weachat_img!=null}}
						<img class="pick_photo" id="imgTx" data-url="{{val.wechat_img}}" data-preview-group="1"/>
						{{else}}
						<img class="pick_photo" id="imgTx"  data-preview-group="1" src="{{val.sex=="F"?"../../images/mrtxF.jpg":"../../images/mrtxM.jpg"}}" />
						{{/if}}
					</td>
					<td>
						<div id="div_name"><label style="font-size:0.14rem;font-weight: bold;padding: 0 0.05rem;color:#000;">
						<span id="customerName">{{val.src!="0"?(val.wechat_memo=="" || val.wechat_memo==null?val.wechat_nm:val.wechat_memo):val.phone_nm}}</span>	
							{{if val.star_flg=="0"}}
						<img  src="../../fonts/iconfont/kx.png" alt="" style="width:0.17rem;height:0.17rem ;">
						{{else}}
						<img  src="../../fonts/iconfont/sx.png" alt="" style="width:0.17rem;height:0.17rem ;">
						{{/if}}
						</label>
					
						</div>
						<div id="div_concat">
							<div id="div_wx" class="display-inline"><i class="mui-icon fa fa-weixin"></i>&nbsp;<label id="label_wx">
							{{if val.wechat_no==null || val.wechat_no==""}}
								<a href="javascript:;"  style="color: #545454;font-size: 0.13rem;">(点击绑定)</a>
								{{else}}
								<span id="wechat_no">{{val.wechat_no}}</span>
								{{/if}}
							</label></div>
							<div id="div_phone" class="display-inline" style="margin-left:0.15rem;"><i class="mui-icon fa fa-mobile"></i>&nbsp;<label id="label_wx">
							{{if val.phone_no==null || val.phone_no==""}}
							<a href="javascript:;" style="color: #545454;font-size: 0.13rem;">(点击绑定)</a>
											{{else}}
									{{val.phone_no}}
								{{/if}}
							</label></div>
							<div id="div_lastInteract"><label  style="font-size: 0.13rem;">上次互动：</label><label id="label_lastInteract" style="font-size: 0.13rem;">
							{{if val.last_touch_date==null || val.last_touch_date==""}}
							 暂无互动
							{{else}}
							{{val.last_touch_date.substr(0,10)}}
							{{/if}}
							</label></div>
							<div id="div_inputType"><label id="label_inputType" style="font-size: 0.13rem;">
							{{ if val.src=="0" }}
							通讯录导入
							{{else if val.src=="1"}}
							 微信导入
							{{else}}
							手工添加
							{{/if}}
							</label><label id="label_inputDate" style="font-size: 0.13rem;">({{val.create_date.substr(0,10)}})</label></div>
						</div>
					</td>
					<td style="width:0.25rem;" >
						<i class="mui-icon mui-icon-forward"></i>
					</td>
				</tr>
			</table>
			<span class="clear10"></span>
			<table class='cont_table float-m9' style="padding:0.1rem 0.1rem;">
				<tr>
					<td><a onclick="insertFollow('{{val.phone_no}}','{{val.cust_id}}','0','{{val.wechat_no}}',false)" href="javascript:;"><i class="i_blue mui-icon mui-icon-phone-filled"></i><label>电话</label></a></td>
					<td><a href="javascript:;" onclick="mui.toast('导航功能暂未开放')" ><i class="i_blue mui-icon mui-icon-map"></i><label>导航</label></a></td>
					<td><a href="javascript:;" onclick="insertFollow('{{val.phone_no}}','{{val.cust_id}}','1','{{val.wechat_no}}',false)" ><i class="i_blue mui-icon mui-icon-weixin"></i><label>微信</label> </a></td>
				</tr>
			</table>
			{{/if}}
			{{/each}}
		</script>
			<script type="text/html" id="label_tp">
				{{each DATASET as val}} 
				{{if val!=''}}
				{{each val.score_label as lab}}
				{{if lab!='' && lab.label!= null && lab.label.trim()!= ""}}
				<span class='tags'>{{lab.label}}</span>
				{{/if}}
				{{/each}}
			{{/if}}
			{{/each}}
		</script>
			<script type="text/html" id="schedule_tp">
				{{each DATASET as val}} {{if val!=''}}
			<li class="mui-table-view-cell mui-collapseli">
				<div class="div_date">
					<span class="sp_date">{{val.sd_date}}</span>
					<span class="sp_month">{{sd_month}}九月</span>
				</div>
				<div class="div_plan">
					<span class="sp_plan_content">{{val.sd_content}}</span>			
					<span class="sp_plan_time">{{val.sd_time}}</span>
					<span class="sp_plan_address">地点：{{val.sd_address}}</span>
				</div>
				<div class="div_location" onclick="" style="float: right;margin-right:0.1rem;vertical-align:middle;">
					<i class="i_blue mui-icon mui-icon-location" style="line-height: 0.67rem;"></i></div>
			</li>
			{{/if}}
			{{/each}}
		</script>
			<script type="text/html" id="action_tp">
				{{each DATASET as val}} {{if val!=''}}
			<li class="mui-table-view-cell mui-collapseli"  style="padding-right: 0px;">
				<div class="div_ac_type " style="background-color: #47BAFE !important">
					<span class="sp_ac_type">{{val.act_nm}}</span>
				</div>
				<div class="div_plan" style="vertical-align: middle; display: inline-block;margin-left:0.15rem;">
					<span class="sp_action_content" style="font-size: 0.15rem; color: #545454;">{{val.act_description}}</span>
					<div class="clear2"></div>
					<span class="sp_action_time">推荐日期：{{val.act_generate_date | dateFormat: 'yyyy-MM-dd'}}</span>
					<span class="sp_action_time" style="float: right;">失效日期：{{val.act_expire_date | dateFormat: 'yyyy-MM-dd'}}</span>

				</div>
				<div class="div_location" onclick="" style="float: right;margin-right:0px;vertical-align:middle;">
					<!-- <i class="i_blue mui-icon mui-icon-plus-filled" style="line-height: 44px;"></i> -->
					</div>
			</li>
			{{/if}}
			{{/each}}
		</script>
			<script type="text/html" id="history_tp">
				{{each DATASET as val}} {{if val!=''}}
					<li class="mui-collapseli " style="padding: 0rem;" >
				<div class="div_ac_type bg_color_blue1" style="margin-left:0px; ">
					<span class="sp_log_type" style="padding: 0rem 0.05rem;" >
					{{ if val.record_id=="" || val.record_id==null}}
                        笔记					
					{{else}}
						录音
					{{/if}}
					</span>
				</div>
				<div class="div_plan" style=" margin-top: 0.1rem;display: inline-block;margin-left:0.15rem;width: calc(100% - 1rem);">
				{{ if val.record_id!="" && val.record_id!=null}}

					<div class="voice" onclick="audioPlay('{{val.audio_file_path}}',this)" style="color: #FFFFFF;">
					  <div class="bg "  style="float: left;"></div>
					  <div style="display: inline-block;height: 0.25rem;line-height: 0.25rem;margin-left: 50%;">{{val.audio_len}}"</div> 
					  </div>
					 <span style="float: right;display: inline-block;height: 0.3rem;line-height: 0.15rem; text-align: center;">{{val.memo_date.substr(0,10)}}<br>{{val.memo_date.substr(10,6)}}</span>
				{{else}}
				
				{{/if}}
					
					<div class="clear2" ></div>
					<!-- <span class="sp_log_time">{{val.sd_time}}</span> -->
					<div class="audiotext_lenbox opentiPrant"   >
						{{ if val.record_id!="" && val.record_id!=null}}
					<div class="sp_log_time audiotext_len chaochu" >{{val.memo_text}}</div>
					{{else}}
					<div class="sp_log_time audiotext_len chaochu" style="margin: 0rem;padding: 0rem;" >{{val.memo_text}}</div>

					{{/if}}
					<div  class="zhankai iconfont" iszhankai="false" style="color: #999;display: none;position: absolute;right: 0.05rem;bottom: 0px;margin:0.05rem 0px;" onclick="opentips(this)">&#xe602;</div>
					</div>
							{{ if val.record_id=="" || val.record_id==null}}
						<span style="display: inline-block;height: 0.3rem; text-align: center;">{{val.memo_date}}</span>
						{{else}}

						{{/if}}
				<!-- 	<div class="audiotip ">
						{{val.audio_text}}
					</div> -->
				</div>
			</li>
			
		
			{{/if}}
			{{/each}}
			
		</script>
			<script type="text/html" id="wfriends_tp">
				{{each DATASET as val}} {{if val!=''}}
			<li class=" mui-collapseli"  style="padding-right: 0px;">
				<div class="div_ac_type " style="background-color: #47BAFE !important">
					<span class="sp_ac_type">朋友圈</span>
				</div>
				<div class="div_plan" style="vertical-align: middle; display: inline-block;margin-left:0.15rem;">
					<div class="sp_log_time wxmoment_text zhankai2box" > <div class="textlength">{{val.moment_text}} </div></div>
					{{if val.moment_link!="" && val.moment_link!=null}}
						<div class=" wxmoment_link" >
						<img src="../../fonts/iconfont/wxllink.png" style="float: left;"  alt=""> 
						<span class="linspan_wx" style="align-items: center;display: flex;" >{{val.moment_link}}</span>	
						</div>
					{{/if}}
				
					<div class="clear2"></div>
					<span class="sp_action_time">{{val.moment_date}}</span>
						<span  class="sp_action_time iconfont zhankai2" style="float: right; font-size: 0.15rem; width: 0.7rem;text-align: right;">&#xe602;</span>
						<span  class="sp_action_time iconfont zhankai22" style="float: right; font-size: 0.15rem; display: none;width: 0.7rem;text-align: right;">&#xe601;</span>
				</div>
				<div class="div_location" onclick="" style="float: right;margin-right:0px;vertical-align:middle;">
					<!-- <i class="i_blue mui-icon mui-icon-plus-filled" style="line-height: 44px;"></i> -->
					</div>
			</li>
			{{/if}}
			{{/each}}
			</script>

				<script type="text/html" id="baoxian_tp">
				{{each DATASET as value}} {{if value!=''}}
				<li class="mui-collapseli ">
					<div class="div_ac_type bg_color_blue1" style="background-color: #0da3ff; width: 0.85rem;text-align: center;">
						<span class="sp_log_type" style="font-size:0.14rem ;">{{value.product_type}}</span>
					</div>
					<div class="div_plan" style="vertical-align: middle;padding-left:0.1rem;">
						<span class="sp_log_content" >{{value.product_nm}}</span>
						<div>
						<span class="sp_log_time" style="color: #5A5A5A; font-size: 0.12rem; margin-right: 0.15rem;">保额：{{value.product_premium/10000}}万</span>
						<span class="sp_log_time">保费：{{value.product_fee}}元</span>
						</div>
						<div>
						<span class="sp_log_time" style="color: #5A5A5A; font-size: 0.12rem; margin-right: 0.15rem;">被保人：{{value.product_beneficial}}</span>
						<span class="sp_log_time">保险期限：{{value.product_period}}年</span>
						</div>

					</div>
					<div class="div_location" onclick="delete_Bx(this,'{{value.product_id}}')" pname="{{value.product_nm}}" id="delete_Bx" style="float: right;vertical-align:middle;" >
						<!-- <i class="i_blue mui-icon fa fa-file-text-o" style="line-height: 0.44rem; font-size:0.2rem;"></i> -->
                              <span style="color: #999999;font-size: 0.25rem;color:"class="iconfont" >&#xe605;</span>
						</div>
				</li>
			{{/if}}
			{{/each}}
		</script>

			<script type="text/javascript">
				script(['../../js/mui.min.js', '../../js/app/common.js', '../../libs/progressbar/progressbar.min.js'], false);
			</script>
			<script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
			<script type="text/javascript">
				var backid = "index.html";
				var backurl = "../" + backid;
				var circle;
				var custId;
                var progname;
				var progimg;
				mui.init({
					pullRefresh: {
						container: '#pullrefresh',
						down: { //下拉刷新
							callback: pulldownRefresh,
							style: mui.os.android ? "circle" : "default"
						}
					},
					beforeback: function() {
						appPage.closeLogin();
					}
				})
				
			
				var ws = null,
					wc = null;
				mui.plusReady(function() {
					
					updateSerivces();
					ws = plus.webview.currentWebview();
					ws.setStyle({
						scrollIndicator:"none"
					})
					// 用户点击后
					ws.addEventListener('maskClick', function() {
						wc.close('auto');
					}, false);
					// mui.ready(function() {
					storage.init();
					storageUser = kidstorageuser.getInstance();
					custId = ws.custId;
				
					initProgressBar();
					getBaseInfo(custId);
					getLbScore(custId);
					// getScheduleList(custId);
					getActionList(custId);
					getScheduleHistoryList(custId);
					getWechatFriends(); //获取微信朋友圈信息
						getInsurance(custId);//保险组合
						setTimeout(function(){
						document.getElementById("lodingGif").style.display="none";
						let isLoadDetail=localStorage.getItem("isLoadDetail");
						if(isLoadDetail!="yes"){
							document.getElementById("mask_navBox").style.display="block";
						}
						plus.nativeUI.closeWaiting();
							document.getElementById("pullrefresh").style.display="block";
						},200);
					localStorage.setItem("isLoadDetail","yes");
				});

				
				function getCalllog(count) {
					var self = plus.webview.currentWebview();
					custId = self.custId;
					request("/cmdb/queryPhoneRecordByCustID/", {
						sales_id: storageUser.UId,
						cust_id: custId
					}, function(data) {
						console.log(JSON.stringify(data));
						let request = data.DATASET;
						document.getElementById("history_count").innerHTML = "（" + (data.DATASET.length + count) + "条）";
					
						if (data.DATASET.length < 0) {
							return;
						}
						let ul = document.getElementById("sHistory_m");
						const fragment = document.createDocumentFragment();

						for (let i = 0; i < data.DATASET.length; i++) {
							const li = document.createElement("li");
							console.log();
							li.className = "mui-collapseli";
							li.style.paddingLeft = "0.0rem";
						
							let creat_time = [];
							let time;
							if (request[i].contact_duration > 60) {
								creat_time.push((request[i].contact_duration / 60).toString().split('.')[0]);
								creat_time.push((request[i].contact_duration % 60));
								if (creat_time[1] < 10) {
									time = creat_time[0] + "分0" + creat_time[1] + "秒";
								} else {
									time = creat_time[0] + "分" + creat_time[1] + "秒";
								}
							} else if (request[i].contact_duration > 3600) {
								creat_time.push((request[i].contact_duration / 3600).toString().split('.')[0]);
								creat_time.push((request[i].contact_duration % 3600));
								if (creat_time[1] < 10) {
									time = creat_time[0] + " 小时0" + creat_time[1] + " 分钟";

								} else {
									time = creat_time[0] + " 小时" + creat_time[1] + " 分钟";
								}
							} else {
								time = request[i].contact_duration + " 秒";
							}
								let contact_type;
							if (request[i].contact_type == "1") {
								contact_type = '<span style="color:#36ab60;font-size:0.13rem" class="iconfont iconhuru">&nbsp;</span> ';
							} else if (request[i].contact_type == "2") {
								contact_type = '<span style="color:#7dc5eb;font-size:0.14rem" class="iconfont iconhuchu">&nbsp;</span> ';
							} else {
								contact_type ='<span style="color:#f07768;font-size:0.14rem" class="iconfont iconweijietong">&nbsp;</span ><span style="color:#f07768;font-size:0.14rem" >未接通</span> ';
								time="";
							}
						
							li.innerHTML =
								'<div class="div_ac_type " style="background-color: #47BAFE !important"><span class="sp_ac_type" style="padding: 0rem 0.05rem;">电话</span></div>' +
								' <div class="div_plan" style="vertical-align: middle; display: inline-block;margin-left:0.15rem;">' +
								' <div class="sp_log_time  " >' + contact_type + time + '</div><div class="clear2"></div>' +
								' <span class="sp_action_time">' + request[i].contact_date.substring(0,16) + '</span></div>' +
								' <div class="iconfont " style="color: #47BAFE;font-size: 0.18rem;">&#xe619;</div>';
							fragment.appendChild(li);

						}
						ul.appendChild(fragment);
					})
				}
				function mask_nav(index){
							let val=parseInt(index);
							switch (val){
								case 1:
								document.getElementById("mask_nav1").style.display="none";
								document.getElementById("mask_nav2").style.display="block";
									break;
								case 2:
								document.getElementById("mask_nav2").style.display="none";
								document.getElementById("mask_navBox").style.display="none";
									break;
								default:
									break;
							}
						}
				function getWechatFriends() {
					var self = plus.webview.currentWebview();
					custId = self.custId;
					request("/cmdb/queryWechatGroupByCustID/", {
						sales_id: storageUser.UId,
						cust_id: custId
					}, function(data) {
						// console.log(JSON.stringify(data));
						document.getElementById("wechat_count").innerHTML = "（" + data.DATASET.length + "条）";
						if (data.DATASET != '') {
							document.getElementById("wfriends_noData").style.display = "none";
						}
						// console.log(JSON.stringif(data));
						render("#wfriends_m", "wfriends_tp", data);
						let moment_textObj = document.getElementsByClassName("wxmoment_text");
						let textlength=document.getElementsByClassName("textlength");
						for (let i = 0; i < data.DATASET.length; i++) {
							let text = data.DATASET[i].moment_text;
							// 替换朋友圈字段字符串中表情text为i标签
							let regex = /\[(.+?)\]/g;
							let emojiObj = text.match(regex);
							let arr = [];
							if (emojiObj != null) {
								for (let j = 0; j < emojiObj.length; j++) {
									let emoji_name = emojiObj[j].split('[')[1].split(']')[0];
									// alert(emoji_name);
									let arrName = ["西瓜", "捂脸", "鼓掌", "呲牙"];
									let isDy = 0;
									for (let s = 0; s < arrName.length; s++) {
										if (emoji_name != arrName[s]) {
											isDy++;
										} else {
											isDy--;
										}
									}
									if (isDy >= arrName.length) {
										text = text.replace(emojiObj[j], "<span style='font-size:0.15rem'> [" + emoji_name.toString() + "] </span>");
									} else {
										text = text.replace(emojiObj[j], "<i class='emoji emoji" + ConvertPinyin(emoji_name.toString()) + "'> </i>");

									}
									// var result=emojiObj[j].replace(emojiObj[j],"<i class='emoji emoji"+ ConvertPinyin(emoji_name.toString())+"'> </i>");
								}
								// alert("表情"+text);
								moment_textObj[i].innerHTML = text;
							}
							// alert(textlength[i].innerHTML);
							// alert(document.getElementsByClassName("textlength")[i].innerHTML);
						}

						// obj=obj.substring(index+1,obj.length);
						let linkspan = document.getElementsByClassName("linspan_wx");
						let zkbtn = document.getElementsByClassName("zhankai2");
						let zkbtn2 = document.getElementsByClassName("zhankai22");
						let zkbox = document.getElementsByClassName("zhankai2box");
						for (let i = 0; i < zkbtn.length; i++) {
							zkbtn[i].addEventListener("tap", function() {
								zkbtn[i].style.display = "none";
								zkbtn2[i].style.display = "block";
								// zkbtn[i].innerHTML="&#xe601;";
								zkbox[i].style.display = "block";
								zkbox[i].style.overflow = "inherit";
							});
							zkbtn2[i].addEventListener("tap", function() {
								zkbtn[i].style.display = "block";
								zkbtn2[i].style.display = "none";
								zkbox[i].style.display = "-webkit-box";
								zkbox[i].style.overflow = "hidden";
							})
						}
					})
				}



				var p = null;

				function audioPlay(url, elm) {
					console.log(url);
					jQuery('.bg').removeClass("voicePlay");
					p = plus.audio.createPlayer(url);
					if (p.isPaused() == true) {
						$(elm).find('.bg').addClass("voicePlay");
						p.play(function() {
							// mui.toast("播放完成");
							jQuery('.bg').removeClass("voicePlay");
							p.stop();
							p = null;
						}, function(e) {
							mui.toast('播放音频文件"' + url + '"失败：' + e.message);
						});
					} else {
						p.stop();
						p = null;
					}
					// document.getElementById("iplay").style.backgroundImage="url(../../fonts/iconfont/audiostop.png)";

				}
              document.getElementById("insertAudio_btn").addEventListener("tap",function(){
				 mui.openWindow({
				 	url: "../sound/programme.html",
				 	id: "programme",
					extras:{
						cust_id:custId,
						name:progname,
						img:progimg,
					},
				 	styles: {
				 		titleNView: {
				 			autoBackButton: true,
				 			backgroundcolor: "#47BAFE",
				 			titleText: "智能笔记",
				 			titlecolor: "white",
				 		}
				 	},
				 	show: {
				 		autoShow: true, //页面loaded事件发生后自动显示，默认为true
				 		aniShow: 'slide-in-bottom', //页面显示动画，默认为”slide-in-right“；
				 	},
				 	waiting: {
				 		autoShow: false
				 	}
				 })
			  }) 
			   
			   function button_nav(index){
				   let val=parseInt(index);
				   switch (val){
				   	case 1:
					// document.getElementById("").style.display="none";
				   		break;
				   	default:
				   		break;
				   }
			   }

				function gotoEdit(id) {
					var self = plus.webview.currentWebview();
					custId = self.custId;
					mui.openWindow({
						url:"customerInfoEdit.html",
						id:"customerInfoEdit.html",
						extras: {
							field: "customerId",
							custId: custId,
							backid: "customer/customerInfoEdit.html"
						},
						styles: {
							titleNView: {
								autoBackButton: true,
								backgroundcolor: "#47BAFE",
								titleText: "编辑资料",
								titlecolor: "white",
								buttons: [{
										fontSrc: 'fonts/iconfont/iconfont.ttf',
										float: 'right',
										text: '\ue609',
										// color:'#0075bb',
										fontSize:'28px',
										onclick: "javascript:plus.webview.getWebviewById('customerInfoEdit.html').evalJS('saveFrom()');"
									},
											
								]
							},
											
						},
						waiting: {
							autoShow: false
						}
					});
					// openNew("../customer/customerInfoEdit.html", {
					// 	field: "customerId",
					// 	custId: custId,
					// 	backid: "customer/customerInfoEdit.html"
					// });
					closeMask();
				}
             
	
				function deteleCustomer() {
					storage.init();
					storageUser = kidstorageuser.getInstance();
					var self = plus.webview.currentWebview();
					custId = self.custId;
					let cname = document.getElementById("deleteCustomer").getAttribute("cname");
				
					mui.confirm('为保障您的信息安全，删除后无法恢复。您确定要删除客户 ' + cname + ' 吗？' , function(e) {
						if (e.index == 0) {
							request("/cmdb/delByCustomerID/", {
								sales_id: storageUser.UId,
								cust_id: custId
							}, function(r) {
								mui.fire(plus.webview.getWebviewById("customer/customer.html"), 'deleteDom',{
									cust_id:custId
								});
								mui.back();
							})
						}
					})
					closeMask();


				}
		function  usestricts(){
				let usestrict=document.getElementById("lingBaoreel");
			  		usestrict.checked = false; 
			  	mui.confirm('是否针对该客户使用灵豹劵?','灵豹提醒',['取消','确认'],function (e) {
			  	 	if(e.index==1){
			  			  request("/cmdb/useLPTicketController/",{
			  				  cust_id:custId,
			  				  sales_id:storageUser.UId
			  			  },function(r){
			  				  if(r.ERROR_CODE.trim()=="ERROR"){
			  					  usestrict.checked = false;
			  				  }else{
			  					  usestrict.checked = true;
									usestrict.setAttribute("disabled","disabled");
								 document.getElementById("lingBaoreelBox").removeEventListener("tap",usestricts2,false)
								  document.getElementById("lingBaoreelBox").removeEventListener("tap",usestricts,false)
			  				  }
			  				  mui.toast(r.ERROR_MESSAGE);
			  
			  			  })
			  		}
			  	 },'div')
		  }  
		  function usestricts2(){
			  mui.toast("请先完善客户手机号信息，以进一步分析");
		  }
				function getBaseInfo(custId) {
					document.getElementById("lingBaoreelBox").removeEventListener("tap",usestricts2,false)
					document.getElementById("lingBaoreelBox").removeEventListener("tap",usestricts,false)

					// requestJsonFile("../../data/customerdetail/baseinfo.json", {custId:custId}, function(r) {
					request("/cmdb/queryByCustomerID/", {
						cust_id: custId,
						sales_id: storageUser.UId
					}, function(r) {
						document.getElementById("deleteCustomer").setAttribute("cname", r.DATASET[0].src == "0" ? r.DATASET[0].phone_nm :
							(r.DATASET[0].wechat_memo == "" || r.DATASET[0].wechat_memo == null ? r.DATASET[0].wechat_nm : r.DATASET[0].wechat_memo)
						);
						//mui.get("../../data/customerdetail/baseinfo.json", {custId:custId}, function(r) {
						// document.getElementById("title_name").innerText=r.DATASET[0].phone_nm;
						render("#baseInfo_div", "baseInfo", r);
					
						 progname=document.getElementById("deleteCustomer").getAttribute("cname");
						 progimg=document.getElementById("imgTx").getAttribute("src");
						appPage.imgInit();

				let usestrict=document.getElementById("lingBaoreel");
						if(r.DATASET[0].used_ticket==1){
								usestrict.checked=true; 
								usestrict.setAttribute("disabled","disabled");
						}else if(r.DATASET[0].phone_no=="" && r.DATASET[0].wechat_phone==undefined){
								document.getElementById("lingBaoreelBox").addEventListener("tap",usestricts2,false)
							usestrict.setAttribute("disabled","disabled");
						}else if(r.DATASET[0].phone_no=="" && r.DATASET[0].wechat_phone==""){
							usestrict.setAttribute("disabled","disabled");
							document.getElementById("lingBaoreelBox").addEventListener("tap",usestricts2,false)
						}else{
						document.getElementById("lingBaoreelBox").addEventListener("tap",usestricts,false)
					}
								
					})
				}
       
	   
				function getLbScore(custId) {
					storage.init();
					storageUser = kidstorageuser.getInstance();
					// requestJsonFile("../../data/customerdetail/score_result.json", {custId:custId}, function(r) {
					request("/cmdb/getScoreByCustId/", {
						// request("/cmdb/queryByCustomerID/", {
						sales_id: storageUser.UId,
						cust_id: custId
					}, function(r) {
						// alert(JSON.stringify(r));
						if (r.DATASET == "") {
							circle.animate(0 / 100);
							circle.setText(0 + "<br>灵豹分");
							render("#score_label", "label_tp", r);
						} else {
							console.log(JSON.stringify(r));
							var score = r.DATASET[0].score;
							circle.animate(score / 100);
							circle.setText(score + "<br>灵豹分");
							render("#score_label", "label_tp", r);
						   let label=document.getElementById("score_label");
							if(label.innerText.trim()==""){
								label.innerHTML="<p style='font-size: 0.12rem;transform: translateY(0.15rem);'>暂无标签（补充更多客户信息，获得更精准结果）</p>"
							}
						}
						//mui.get("../../data/customerdetail/score_result.json", {custId:custId}, function(r) {
						//log(r);

					})
				}

				// function getScheduleList(custId) {
				// 	requestJsonFile("../../data/customerdetail/schedule_info.json", {
				// 		custId: custId
				// 	}, function(r) {
				// 		//mui.get("../../data/customerdetail/schedule_info.json", {custId:custId}, function(r) {
				// 		//log(r);
				// 			document.getElementById("schedule_count").innerText = "（" + r.DATASET.length + "条）"
				// 			render("#schedule_m", "schedule_tp", r);
				// 			document.getElementById('schedule_plan').classList.remove('mui-hidden');
				// 		
				// 	})
				// }

				function getScheduleHistoryList(custId) {
					storage.init();
					storageUser = kidstorageuser.getInstance();
					request("/cmdb/queryAudioMemosByCustID/", {
						cust_id: custId,
						sales_id: storageUser.UId
					}, function(r) {

						//mui.get("../../data/customerdetail/schedule_history.json", {custId:custId}, function(r) {
						//log(r);
						console.log(JSON.stringify(r));
						// document.getElementById("history_count").innerText = "（" + r.DATASET.length + "个）";
						render("#sHistory_m", "history_tp", r);
						getCalllog(r.DATASET.length); //获取通话记录
						console.log(JSON.stringify(r));
						let audiotext_lenbox = $(".audiotext_lenbox");
						for (let i = 0; i < audiotext_lenbox.length; i++) {
							if (jQuery(audiotext_lenbox[i]).find(".audiotext_len").width() > $(audiotext_lenbox[i]).width()) {
								jQuery(audiotext_lenbox[i]).find(".zhankai").css("display", "inline-block");
							}
						}

					})
				}

				function opentips(elm) {
					jQuery(".zhankai").parent().addClass("opentiPrant");
					jQuery(".zhankai").prev().addClass("chaochu");
					jQuery(".zhankai").html("&#xe602;");
					if (jQuery(elm).attr("iszhankai") == "false") {
						jQuery(elm).parent().removeClass("opentiPrant");
						jQuery(elm).prev().removeClass("chaochu");
						jQuery(elm).html("&#xe601;");
						jQuery(elm).attr("iszhankai", "true");
					} else {
						jQuery(elm).parent().addClass("opentiPrant");
						jQuery(elm).prev().addClass("chaochu");
						jQuery(elm).html("&#xe602;");
						jQuery(elm).attr("iszhankai", "false");
					}

				}

				function formatDate(dateArg) { //日期格式化
					const date = new Date(dateArg);
					const year = date.getFullYear();
					const month = date.getMonth() + 1;
					const day = date.getDate();
					const formatMonth = month < 10 ? `0${month}` : month;
					const formatDay = day < 10 ? `0${day}` : day;
					return `${year}-${formatMonth}-${formatDay}`
				};

				function getActionList(custId) {
					// requestJsonFile("../../data/customerdetail/action_info.json", {custId:custId}, function(r) {
					request("/cmdb/getCurDateSuggestAction/", {
						cust_id: custId,
						sales_id: storageUser.UId,
						work_date: formatDate(new Date())
					}, function(r) {
						document.getElementById("action_count").innerText = "（" + r.DATASET.length + "个）"
						if (r.DATASET.length > 0) {
							document.getElementById("action_noData").style.display = "none";
						}
						template.helper('dateFormat', Utils.dateFormat);
						render("#action_m", "action_tp", r);


					})
				}
				//下拉刷新具体业务实现
				function pulldownRefresh() {
					// setTimeout(function() {
						//下拉刷新结束
						getBaseInfo(custId);
						getLbScore(custId);
						// getScheduleList(custId);
						getActionList(custId);
						getInsurance(custId);//保险组合
						getScheduleHistoryList(custId);
						mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
						//重置上拉加载
						// mui('#pullrefresh').pullRefresh().refresh(true);
						//重置页码
						page = 1;
					// }, 1000);
				}

				function initProgressBar() {
					circle = new ProgressBar.SemiCircle('#progress', {
						strokeWidth: 7,
						color: '#47BAFE',
						trailColor: '#f4f4f4',
						duration: 3000,
						easing: 'easeInOut',
						text: {
							value: '0<br>灵豹分',
							className: 'progressbar__label',
							style: {
								// Text color.
								// Default: same as stroke color (options.color)
								color: '#5A5A5A',
								position: 'absolute',
								left: '50%',
								top: '50%',
								bottom: 0,
								padding: 0,
								margin: 0,
								// You can specify styles which will be browser prefixed
								transform: {
									prefix: true,
									value: 'translate(-50%, -50%)'
								}
							},
							autoStyleContainer: true,
							alignToBottom: true
						}
					});
					circle.text.style.fontSize = '0.15rem';
				}
				var obj = document.getElementById("mask");
				obj.addEventListener("click", showmore);
				let yn = 0;

				function closeMask() {
					document.getElementById("topPopover").style.display = "none",
						obj.style.display = "none";
					yn = 0;
				}

				function showmore() {
					if (yn == 0) {
						document.getElementById("topPopover").style.display = "inline",
							obj.style.display = "inline";
						yn = 1;
					} else {
						closeMask();
						yn = 0;
					}

				}

				function insertFollow(phone_no, id, act_type, wechat_no, isGj) {
					switch (parseInt(act_type)) {
						case 0:
							if (mui.os.plus) {
								if (phone_no != "" && phone_no != null) {
									plus.device.dial(phone_no);
									isGj = true;
								} else {
									mui.toast("还没有绑定客户手机号！");
								}
							} else {
								location.href = "tel:" + phone_no;
							}
							break;
						case 1:
							var timeout, t = 1000,
								hasApp = true;
							setTimeout(function() {
								if (!hasApp) {
									//没有安装微信
									var r = confirm("您没有安装微信，请先安装微信!");
									if (r == true) {
										location.href = "http://weixin.qq.com/"
									}
								} else {
									//安装微信
								}
								// document.body.removeChild(ifr);
							}, 2000);
							if (wechat_no != "" && wechat_no != null) {
								// mui.toast("正在跳转微信...");
								copy_fun(wechat_no,"微信ID已复制，可粘贴到微信搜索框，查找客户开始聊天");  	
								isGj = true;
								setTimeout(function() {
									location.href = "weixin://";
								}, 1000);
							} else {
								mui.toast("还没有绑定客户微信号信息！");
							}
							break;

					}
					if (isGj == true) {
						request("/cmdb/insertLpActFollowup/", {
							id: "99999999999999999999999999999999",
							sales_id: storageUser.UId,
							cust_id: id,
							act_followup_type: act_type
						}, function(result) {
							// mui.toast(JSON.stringify(result));
							pulldownRefresh();
						});
					}

				}
				document.addEventListener("xlsx",function(){
					pulldownRefresh();
				})
				function getInsurance(custId){ //保险组合查询
				storage.init();
				storageUser = kidstorageuser.getInstance();
					 request("/cmdb/queryProductByCustID/",{
						 sales_id:storageUser.UId,
						 cust_id:custId
					 },function(data){
						 if(data.DATASET.length>0){
							 document.getElementById("insurance-count").innerText="（"+data.DATASET.length+"份）";
							 document.getElementById("shareBx").style.display="block";
						 }else{
							 document.getElementById("insurance-count").innerText="（0份）";
							 document.getElementById("shareBx").style.display="none";
						 }
						 render("#baoxian_Ul","baoxian_tp",data);
					 })
				}
				document.addEventListener("shuaxin", function(e) {
					//下拉刷新结束
					getBaseInfo(custId);
					getInsurance(custId);
					plus.webview.currentWebview().setStyle({titleNView:{titleText:e.detail.custName}});
					mui('#pullrefresh').pullRefresh().endPulldownToRefresh();
					//重置上拉加载
					// mui('#pullrefresh').pullRefresh().refresh(true);
					//重置页码
					page = 1;
				})
					
				document.getElementById("insertBx_btn").addEventListener("tap", function() {
					if (wc) {
						return;
					}

					// 开启遮罩
					ws.setStyle({
						mask: 'rgba(0,0,0,0.5)'
					});
					// 创建侧滑页面
					wc = createWithoutTitle('../insurance/insuranceAdd.html', {
						width: '100%',
						popGesture: 'none',
						top:"0%",
						height:"100%",
						titleNView: false
					});
					// 侧滑页面关闭后关闭遮罩
					wc.addEventListener('close', function() {
						ws.setStyle({
							mask: 'none'
						});
						wc = null;
					}, false);
					// 侧滑页面加载后显示（避免白屏）
					wc.addEventListener('loaded', function() {
						wc.show('slide-in-bottom');
					}, false);
						storage.init();
					storageUser = kidstorageuser.getInstance();
					let webviewAdd = plus.webview.getWebviewById("../insurance/insuranceAdd.html");
					mui.fire(webviewAdd, 'getName', { //自定义事件
					    cust_id:custId,
						sales_id:storageUser.UId,
						name: document.getElementById("customerName").innerText,
						img: document.getElementById("imgTx").getAttribute("src")
					});
				})



				var shares = null;
				var sweixin = null;
				var buttons = [{
						title: '微信好友',
						extra: {
							scene: 'WXSceneSession'
						}
					},
					{
						title: '微信朋友圈',
						extra: {
							scene: 'WXSceneTimeline'
						}
					},
					{
						title: '微信收藏',
						extra: {
							scene: 'WXSceneFavorite'
						}
					}
				];

				/**
				 * 更新分享服务
				 */
				function updateSerivces() {
					plus.share.getServices(function(s) {
						shares = {};
						for (var i in s) {
							var t = s[i];
							shares[t.id] = t;
						}
						sweixin = shares['weixin'];
					}, function(e) {
						mui.toast('获取分享服务列表失败：' + e.message);
					});
				}
               
			   //删除保险组合

				// 分享网页
 
				document.getElementById("shareBx").addEventListener("tap", function() {
					// window.location.href = "../insurance/customerShare.html";
					storage.init();
					storageUser = kidstorageuser.getInstance();
					mui.openWindow({
						url:"../insurance/customerShare.html",
						id:"insurance/customerShare.html",
						extras:{
							 name: document.getElementById("customerName").innerText,
							img: document.getElementById("imgTx").getAttribute("src"),
							sales_id:storageUser.UId,
							cust_id:custId
						},
						 waiting:{
							 autoShow:false
						 }
					});
				 // openNew("../insurance/customerShare.html",{
					//  name: document.getElementById("customerName").innerText,
					//  img: document.getElementById("imgTx").getAttribute("src"),
					//  sales_id:storageUser.UId,
					//  cust_id:custId
				 // })
              
					// openNew("../insurance/customerShare.html",{
					// 	name: document.getElementById("customerName").innerText,
					// 	img: document.getElementById("imgTx").getAttribute("src"),
					// 	sales_id:storageUser.UId,
					// 	cust_id:custId
					// });
						
					// 	var link = "www.baidu.com";
					// 	var title ="灵豹保险专家";
					// 	var content="快来看看"+document.getElementById("customerName").innerText+"购买的保险组合吧";
					// 	var url=link;
					//  var msg={type:'web',thumbs:['../../images/logo.png']};
					//   msg.href=url;
					//   msg.title=title;
					// msg.content=content;
					// sweixin?plus.nativeUI.actionSheet({title:'分享给朋友',cancel:'取消',buttons:buttons}, function(e){
					//  	(e.index>0)&&share(sweixin, msg, buttons[e.index-1]);
					//  }):plus.nativeUI.alert('当前环境不支持微信分享操作!'); 
				});
				function delete_Bx(elment,id){
							let bxname=elment.getAttribute("pname");
					  mui.confirm('确定移除这份 ' + bxname + ' 吗？', function(e) {
						if (e.index == 0) {
							request("/cmdb/deleteProductByProductID/", {
								product_id:id,
							}, function(r) {
								if(r.ERROR_CODE=="SUCCESS"){
									pulldownRefresh();
								}else{
									mui.toast("服务器错误");
								}
							})
						}
					})

				}
								  
				// 执行分享
				function share(srv, msg, button) {
					// outSet('分享操作：');
					if (!srv) {
						mui.toast('无效的分享服务！');
						return;
					}
					button && (msg.extra = button.extra);
					// 发送分享
					if (srv.authenticated) {
						// outLine('---已授权---');
						doShare(srv, msg);
					} else {
						mui.toast('---未授权---');
						srv.authorize(function() {
							doShare(srv, msg);
						}, function(e) {
							mui.toast('认证授权失败：' + JSON.stringify(e));
						});
					}
				}
				// 发送分享
				function doShare(srv, msg) {
					// outLine(JSON.stringify(msg));
					srv.send(msg, function() {
						mui.toast('分享到"' + srv.description + '"成功！');
					}, function(e) {
						mui.toast('分享到"' + srv.description + '"失败: ' + JSON.stringify(e));
					});
				}
				// 解除授权
				function cancelAuth() {
					mui.toast('解除授权：');
					if (sweixin) {
						if (sweixin.authenticated) {
							mui.toast('取消"' + sweixin.description + '"');
						}
						sweixin.forbid();
					} else {
						mui.toast('当前环境不支持微信分享操作!');
					}
				}
				
			</script>
	</body>
</html>
